(*
    Only for OrangeCrab, Nano 9k ALU don't support multiplication.
    Highest led sets according button status (via multiplication), others used as counter.
*)

MEM ledr = 1136, buttonr = 1140;
VAR led;

PROCEDURE delay;
    VAR cnt;
BEGIN
    cnt := 0;
    WHILE cnt < 50000 DO
        cnt := cnt + 1
    END
END;

BEGIN
    led := 0;
    WHILE 1 = 1 DO
        led := led + 1;
        IF led = 4 THEN
            led := 0
        END;
        ledr := led + (buttonr * 4);
        
        CALL delay
    END
END.
